package com.coder.network.request

import okhttp3.Interceptor
import okhttp3.Response
import java.io.IOException

/**
 * 请求拦截：添加Header
 *
 * @author yuhushuan
 * @date 2017/8/4 14:25
 */
class RequestInterceptor : Interceptor {
    @Throws(IOException::class)
    override fun intercept(chain: Interceptor.Chain): Response {
        val newRequest = chain.request().newBuilder()
                .addHeader("Accept-Encoding", "identity")
                .build()
        return chain.proceed(newRequest)
    }
}